#include<cstdio>
#include<cmath>

bool check(int number) {
    int a = sqrt(number);
    for (int i=a; i>1; i--) {
        if (number % i == 0) 
            return false;
    }
    return true;
}

int main() {
    int a;
    scanf("%d", &a);
    if(check(a)) 
        printf("YES");
    else
        printf("NO");
    return 0;
}